package com.ocom.webapi.feign;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.ocom.common.constant.HumanServiceUrl;
import com.ocom.common.constant.WxServiceUrl;
import com.ocom.common.dto.Department;
import com.ocom.common.dto.EditMngUserFormDto;
import com.ocom.common.dto.GetMngUserFormDto;
import com.ocom.common.dto.RefreshUserDockDto;
import com.ocom.common.entity.human.*;
import com.ocom.common.request.company.companyrole.SetPageByRoleRequest;
import com.ocom.common.request.human.*;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.PersonVo;
import com.ocom.common.vo.human.KqStudentVo;
import com.ocom.common.vo.human.UserListRVo;
import com.ocom.common.vo.human.UserListVo;
import com.ocom.common.vo.webapi.ExcelAddPersonVo;
import com.ocom.webapi.vo.studentpage.BoardersImportVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(value = "human")
public interface HumanClientService {
    /**
     * 获取部门列表
     * @param comID 单位编号
     * @param deptID 部门编号
     * */
    @GetMapping(HumanServiceUrl.URL_Department_GetDeptInfo)
    public Result GetDeptInfo(@RequestParam("comID") Long comID,@RequestParam("deptID")  Long deptID,
                              @RequestParam("deptName")String deptName);


    /***
     * 新增部门
     * @param map 对象
     */
    @PostMapping(HumanServiceUrl.URL_Department_AddDeptInfo)
    public Result AddDeptInfo(@RequestBody Map<String, Object> map);

    /**修改部门*/
    @PostMapping(HumanServiceUrl.URL_Department_UpdateDept)
    public Result UpdateDept(@RequestBody Map<String, Object> map);


    /**删除部门*/
    @PostMapping(HumanServiceUrl.URL_Department_DelDept)
    public Result DelDept(@RequestBody Map<String, Object> map);


    /**
     * 获取人员列表personnel/getPersonInfo
     * */
    @PostMapping(HumanServiceUrl.URL_PersonnelGetPersonInfo)
    public Result PersonnelGetPersonInfo(@RequestBody Map<String, Object> map);


    /**
     * 新增人员信息
     * */
    @PostMapping(HumanServiceUrl.URL_PersonnelAddPerson)
    public Result AddPerson(@RequestBody Map<String, Object> map);


    /**修改人员信息*/
    @PostMapping(HumanServiceUrl.URL_PersonnelUpdatePerson)
    public Result UpdatePerson(@RequestBody Map<String, Object> map);

    /**
     * 获取人员信息 getPersonInfo
     * */
    @GetMapping(HumanServiceUrl.URL_GetPersonInfo)
    public Result GetPersonInfo(@RequestParam("comId") Long comId,@RequestParam("pId")Long pId);

    @PostMapping(HumanServiceUrl.URLP_removePerson)
    Result  removePerson(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId,@RequestParam("userId")Long userId);


    @PostMapping(HumanServiceUrl.URL_GetMngUserInfo)
    public Result getMngUserInfo(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_AddMngUserInfo)
    public Result accountPageAdd(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_UpdateMngUserInfo)
    public Result accountPageModify(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_DeleteMngUserInfo)
    public Result deleteMngUserInfo(@RequestBody JSONObject jsonObject);


    //获取下级部门信息（department/getDeptInfos）
    @PostMapping(HumanServiceUrl.URL_DepartmentGetDeptInfos)
    public Result departmentGetDeptInfos(@RequestBody Department deleteDeptDto);

    //获取部门id（department/getDeptIds）
    @PostMapping(HumanServiceUrl.URL_DepartmentGetDeptIds)
    public Result getDeptIds(@RequestBody Department department);


    /**
     * 导入同住人（ importBorders）
     * */
    @PostMapping(HumanServiceUrl.URL_ImportBorders)
    public Result ImportBorders(@RequestParam("comId")Long comId,@RequestBody List<BoardersImportVo> boardersImportVos);

    /**
     * 删除同住人（removeRoommate）
     * */
    @PostMapping(HumanServiceUrl.URL_RemoveRoommate)
    public Result RemoveRoommate(@RequestBody Map<String,Object> map);

    /**
     * 新增同住人（addRoommate）
     * */
    @PostMapping(HumanServiceUrl.URL_AddRoommate)
    public Result AddRoommate(@RequestBody EntityRoommateInfo entityRoommateInfo);

    /**
     * 获取同住人列表（getRoommateList）
     * */
    @PostMapping(HumanServiceUrl.URL_GetRoommateList)
    public Result GetRoommateList(@RequestBody Map<String,Object> map);

    /**
     * 获取学生列表  personnel/getStudentInfo
     * */
    @PostMapping(HumanServiceUrl.URL_PersonnelGetStudentInfo)
    public Result PersonnelGetStudentInfo(@RequestBody Map<String,Object> map);

    /**
     * 获取审批负责人列表  (getVisitorApprover)
     * */
    @PostMapping(HumanServiceUrl.URL_GetVisitorApprover)
    public Result GetVisitorApprover(@RequestBody Map<String,Object> map);

    /**
     * 添加审批负责人列表  (addVisitorApprover)
     * */
    @PostMapping(HumanServiceUrl.URL_AddVisitorApprover)
    public Result AddVisitorApprover(@RequestBody Map<String,Object> map);

    /**
     * 修改审批负责人列表  (updateVisitorApprover)
     * */
    @PostMapping(HumanServiceUrl.URL_UpdateVisitorApprover)
    public Result UpdateVisitorApprover(@RequestBody Map<String,Object> map);

    /**
     * 删除审批负责人列表  (deleteVisitorApprover)
     * */
    @PostMapping(HumanServiceUrl.URL_DeleteVisitorApprover)
    public Result DeleteVisitorApprover(@RequestBody Map<String,Object> map);

    @PostMapping(HumanServiceUrl.URL_AddMngUserInfo)
    public Result addMngUserInfo(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_UpdateMngUserInfo)
    public Result UpdateMngUserInfo(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_GetMngUserForm)
    public Result getMngUserFormSelected(@RequestBody GetMngUserFormDto dto);

    @PostMapping(HumanServiceUrl.URL_EditMngUserForm)
    public Result editMngUserFormSelected(@RequestBody EditMngUserFormDto dto);

    /**
     * 获取审批记录列表  (getVisitorRecord)
     * */
    @PostMapping(HumanServiceUrl.URL_GetVisitorRecord)
    public Result GetVisitorRecord(@RequestBody Map<String,Object> map);


    @PostMapping(HumanServiceUrl.URL_Department_GetDeptList)
    public Result<List<EntityDeptInfo>> getDeptList(@RequestParam("companyId") Long companyId,@RequestParam("deptId") Long deptId,@RequestParam("show") Integer show);


    // 人员列表查询（getPersonnelList）
    @PostMapping(HumanServiceUrl.URL_GetPersonnelList)
    public Result<PageInfo<UserListRVo>> GetPersonnelList(@Validated @RequestBody Map<String,Object> map);

    // 人员列表查询（getPersonnelList）
    @PostMapping(HumanServiceUrl.URL_GetPersonnelList)
    public Result GetPersonnelList(@RequestBody UserListVo userListVo);


    // 获取人员信息的未脱敏的信息(getPersonnelNoDesensitized)
    @GetMapping(HumanServiceUrl.URL_GetPersonnelNoDesensitized)
    public Result GetPersonnelNoDesensitized(@RequestParam("comId") Long comId,@RequestParam("pId") Long pId);


    /**
     * 导入人员信息（importUserInfo）
     * */
    @Deprecated
    @PostMapping(HumanServiceUrl.URL_ImportUserInfo)
    public Result ImportUserInfo(@RequestBody ExcelAddPersonVo excelAddPersonVo);


    /**
     * 服务消息推送列表（getMsgYkmConfigList）
     * */
    @GetMapping(HumanServiceUrl.URL_GetMsgYkmConfigList)
    public Result GetMsgYkmConfigList(@RequestParam("comId") Long comId);


    /**
     * 服务消息新增（addMsgYkmConfig）
     * */
    @PostMapping(HumanServiceUrl.URL_AddMsgYkmConfig)
    public Result AddMsgYkmConfig(Map<String,Object> map);

    //2.12.2获取系统角色列表
    @GetMapping(HumanServiceUrl.URL_getSysRoleList)
    public Result getSysRoleList();

    //3.26
    @PostMapping(HumanServiceUrl.URL_getPageEnumByType)
    public Result getPageEnumByType(@RequestParam("type") String type);

    //获取角色网页权限
    @PostMapping(HumanServiceUrl.URL_getRolePagePermission)
    public Result getRolePagePermission(@RequestParam("role") Integer role,@RequestParam("comId") Long comId,@RequestParam("pageId") Integer pageId);

    //添加WEB页面（addWebPage）
    @PostMapping(HumanServiceUrl.URL_addWebPage)
    public Result addWebPage(@RequestParam("pageCode") String pageCode,@RequestParam("pageName") String pageName,@RequestParam("description") String description,@RequestParam("pageAppCode") String pageAppCode,@RequestParam("parentId") Integer parentId);

    //设置页面权限（setPagePermission）
    @PostMapping(HumanServiceUrl.URL_setPagePermission)
    public Result setPagePermission(@RequestBody JSONObject jsonObject);

    @GetMapping(HumanServiceUrl.URLP_getWebPageList)
    public Result webPageList(@RequestParam("parentId") Integer parentId);

    //修改WEB页面
    @PostMapping(HumanServiceUrl.URL_modifyWebPage)
    public Result modifyWebPage(@RequestParam("pageId") Integer pageId,@RequestParam("pageName") String pageName,@RequestParam("description") String description,@RequestParam("pageCode") String pageCode,@RequestParam("pageAppCode") String pageAppCode,@RequestParam("parentId") Integer parentId);

    //获取角色按钮权限
    @PostMapping(HumanServiceUrl.URL_getRoleButtonPermission)
    public Result getRoleButtonPermission(@RequestParam("role") Integer role,@RequestParam("comId") Integer comId,@RequestParam("pageId") Integer pageId);

    //获取网页按钮列表
    @PostMapping(HumanServiceUrl.URL_getWebButtonList)
    public Result getWebButtonList(@RequestParam("pageId") Integer pageId);

    //删除页面按钮（deleteWebButton）
    @PostMapping(HumanServiceUrl.URL_deleteWebButton)
    public Result deleteWebButton(@RequestParam("pageId") Integer pageId,@RequestParam("buttonId") Integer buttonId);

    //添加WEB页面按钮（addWebButton）
    @PostMapping(HumanServiceUrl.URL_addWebButton)
    public Result addWebButton(@RequestParam("pageId") Integer pageId,@RequestParam("buttonCode") String buttonCode,@RequestParam("buttonName") String buttonName,@RequestParam("description") String description);

    //修改WEB页面按钮（modifyWebButton）
    @PostMapping(HumanServiceUrl.URL_modifyWebButton)
    public Result modifyWebButton(@RequestParam("pageId") Integer pageId,@RequestParam("buttonId") Integer buttonId,@RequestParam("buttonName") String buttonName,@RequestParam("description") String description);

    //获取消费版本列表
    @PostMapping(HumanServiceUrl.URL_getXfVerList)
    public Result getXfVerList();

    //取门禁版本列表
    @PostMapping(HumanServiceUrl.URL_getMjVerList)
    public Result getMjVerList();

    //获取门禁版本列表
    @PostMapping(HumanServiceUrl.URL_getSaasMenuList)
    public Result getSaasMenuList(@RequestParam("saasNo") Integer saasNo);

    //删除Saas菜单
    @PostMapping(HumanServiceUrl.URL_removeSaasMenu)
    public Result removeSaasMenu(@RequestParam("saasNo") Integer saasNo,@RequestParam("menuId") Integer menuId);

    //上移Saas菜单
    @PostMapping(HumanServiceUrl.URL_moveUpSaasMenu)
    public Result moveUpSaasMenu(@RequestParam("saasNo") Integer saasNo,@RequestParam("menuId") Integer menuId);

    //下移Saas菜单
    @PostMapping(HumanServiceUrl.URL_moveDownSaasMenu)
    public Result moveDownSaasMenu(@RequestParam("saasNo") Integer saasNo,@RequestParam("menuId") Integer menuId);

    //添加Saas菜单
    @PostMapping(HumanServiceUrl.URL_addSaasMenu)
    public Result addSaasMenu(@RequestBody JSONObject jsonObject);

    //修改Saas菜单
    @PostMapping(HumanServiceUrl.URL_modifySaasMenu)
    public Result modifySaasMenu(@RequestBody JSONObject jsonObject);

    //获取SaaS列表
    @PostMapping(HumanServiceUrl.URL_getSaasList)
    public Result getSaasList();

    @PostMapping(HumanServiceUrl.URL_getSaasMenuByRole)
    public Result getSaasMenuByRole(@RequestBody JSONObject jsonObject);

    @PostMapping(HumanServiceUrl.URL_getCustomRolePower)
    public Result getCustomRolePower(@RequestBody JSONObject jsonObject);

    //批量添加部门
    @PostMapping(HumanServiceUrl.URL_departmentAddDepts)
    public Result departmentAddDepts(@RequestBody JSONObject jsonObject);

    //删除
    @PostMapping(HumanServiceUrl.URL_DeleteRolePermission)
    public Result deleteRolePermission(@RequestParam("role") Integer role);

    //删除
    @PostMapping(HumanServiceUrl.URL_SetRolePermission)
    public Result setRolePermission(@RequestBody SetPageByRoleRequest request);

    //删除
    @PostMapping(HumanServiceUrl.URL_RefreshUserDock)
    public Result refreshUserDock(@RequestBody RefreshUserDockDto request);

    @PostMapping(HumanServiceUrl.URL_getPerTag)
    public Result getPerTag(@RequestParam("comId") Long comId,@RequestParam("state") Integer state, @RequestParam("groupNo") Integer groupNo);

    @PostMapping(HumanServiceUrl.URL_addPerTag)
    public Result addPerTag(@RequestBody EntityPersonTag entityPersonTag);

    @PostMapping(HumanServiceUrl.URL_updatePerTag)
    public Result updatePerTag(@RequestBody EntityPersonTag entityPersonTag);

    @PostMapping(HumanServiceUrl.URL_getPerTagGroup)
    public Result getPerTagGroup(@RequestParam("comId") Long comId);

    @PostMapping(HumanServiceUrl.URL_addPerTagGroup)
    public Result addPerTagGroup(@RequestParam("comId") Long comId, @RequestBody EntityPersonTagType entityPersonTagType);

    @PostMapping(HumanServiceUrl.URL_updatePerTagGroup)
    public Result updatePerTagGroup(@RequestParam("comId") Long comId, @RequestBody EntityPersonTagType entityPersonTagType);

    @PostMapping(HumanServiceUrl.URL_removePerTagGroup)
    public Result removePerTagGroup(@RequestBody RemovePerTagGroupRequest request);

    @PostMapping(HumanServiceUrl.URL_managePerTagRelation)
    public Result managePerTagRelation(@RequestBody ManagePerTagRelationRequest request);


    //消费的用户信息
    @PostMapping(HumanServiceUrl.URL_getXfUserInfo)
    public Result getXfUserInfo(@RequestParam("comId")Long comId,@RequestParam("pId")Long pId);


    @PostMapping(HumanServiceUrl.URL_PersonnelGetPerFeature)
    public Result personnelGetPerFeature(@RequestBody GetPerFeatureRequest request);

    @PostMapping(HumanServiceUrl.URL_PersonnelReset)
    public Result personnelReset(@RequestBody GetPerFeatureRequest request);


    @PostMapping(HumanServiceUrl.URL_getMngUserInfoById)
    public Result getMngUserInfoById(@RequestParam("userId")Integer userId) ;




    @PostMapping(HumanServiceUrl.URL_getPersonByPCodes)
    public Result<List<EntityPersonnelInfo>> getPersonByPCodes(@RequestBody GetPersonByPCodesRequest request);

    @PostMapping(HumanServiceUrl.URL_getPersonByIds)
    Result<List<EntityPersonnelInfo>> getPersonByIds(@RequestBody GetPersonByPIdsRequest request);

    @PostMapping(HumanServiceUrl.URL_getKqAndStudentsDetail)
    public Result getKqAndStudentsDetail(@RequestBody StudentsDetailRequest request);

    @PostMapping(HumanServiceUrl.URL_getStudentDateKq)
    public Result getStudentDateKq(@RequestBody StudentsDateOnlineRequest request) ;


    @PostMapping(HumanServiceUrl.URL_studentsKqBydaysDetail)
    public Result studentsKqBydaysDetail(@RequestBody StudentsKqBydaysDetailRequest request);

    @PostMapping(HumanServiceUrl.URL_getKqAndStudentsOnline)
    public Result<List<KqStudentVo>> getKqAndStudentsOnline(@RequestBody StudentsOnlineRequest request);

    @PostMapping(HumanServiceUrl.URL_getUserBypIds)
    public Result getUserBypIds(@RequestBody GetUserBypIdsReq request);


    @PostMapping(WxServiceUrl.URL_modifyPhoto)
    public Result modifyPhoto(@RequestBody PersonVo personVo);


    @PostMapping(HumanServiceUrl.URL_PersonnelPhotoFeature)
    public Result featureList(@RequestBody FaceFeatureRequest request);

}
